package cn.fjsay.java.demo8;

class Ladder {
    private double upperBase;
    private double lowerBase;
    private double height;

    public Ladder(double upperBase, double lowerBase, double height) {
        this.upperBase = upperBase;
        this.lowerBase = lowerBase;
        this.height = height;
    }

    public double getUpperBase() {
        return upperBase;
    }

    public double getLowerBase() {
        return lowerBase;
    }

    public double getHeight() {
        return height;
    }

    public double calculateArea() {
        return (upperBase + lowerBase) * height / 2;
    }
}
